<%@ include file="/taglibs.jsp"%>

<title><fmt:message key="userList.title"/></title>
<s:set name="users" value="users" scope="request"/>

<s:form name="listUserForm" action="getUserByGrp" method="post" validate="false">
	<s:select key="userList.form.filter.group" list="listGrp" value="groupId" name="groupId" listKey="id" listValue="name" onchange="form.submit()" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
</s:form>
<s:form name="listUserForm" action="getUserByDept" method="post" validate="false">
	<s:select key="userList.form.filter.department" list="listDepartment" value="departmentId" name="departmentId" listKey="id" listValue="name" onchange="form.submit()" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
</s:form>

<div align="right">
	<button onclick="location.href='editUser.html'" style="text-align: center;">
		<fmt:message key="button.add.title"></fmt:message>
		<img src="${ctx}/images/btn_add.png" align="left" height="20" width="20">
	</button>
	<button onclick="location.href='load_search_user.html'">
		<fmt:message key="button.search.title"></fmt:message>
		<img src="${ctx}/images/btn_search.png" align="left" height="20" width="20">
	</button>
</div>
<display:table name="users" class="table" requestURI="" id="userList"  pagesize="10">
    <display:column property="username" href="editUser.html" media="html"
        paramId="id" paramProperty="id" sortable="true" titleKey="user.username" escapeXml="true"/>
    <display:column sortable="true" titleKey="user.fullname">
    	${userList.firstName}   ${userList.lastName}
    </display:column>
    <display:column sortable="true" titleKey="user.department" property="department.name"/>
    <display:column sortable="true" titleKey="user.position" property="position.name"/>
</display:table>

<script type="text/javascript">highlightTableRows("userList");</script>

	<button onclick="location.href='editUser.html'" style="text-align: center;">
		<fmt:message key="button.add.title"></fmt:message>
		<img src="${ctx}/images/btn_add.png" align="left" height="20" width="20">
	</button>
	<button onclick="location.href='load_search_user.html'">
		<fmt:message key="button.search.title"></fmt:message>
		<img src="${ctx}/images/btn_search.png" align="left" height="20" width="20">
	</button>